/*
 * @Description: 路由跳转
 * @Author: buwei.huang
 * @Date: 2019-06-12 15:05:00
 * @Last Modified by: buwei.huang
 * @Last Modified time: 2019-06-12 16:07:29
 */

import { open } from './JumpUtils'

function goToPage(url, params) {
  if (params) {
    if (url.indexOf('?') > 0) {
      // url包含?则后面添加&
      url += '&'
    } else {
      url += '?'
    }
    url += params
  }
  open(url)
}

// 修改密码
function goToEditPassword(params = null) {
  let url = 'city-app/modifyloginpwd.html'
  goToPage(url, params)
}

// 设置密码
function goToSetPassword(params = null) {
  let url = 'city-app/setloginpwd.html'
  goToPage(url, params)
}

// 跳转注销账号风险提示
function goToLogoutAccountRe(params = null) {
  let url = 'logoutAccountRe.html'
  goToPage(url, params)
}

// 跳转注销账号
function goToLogoutAccount(params = null) {
  let url = 'logoutAccount.html?_tv=false'
  goToPage(url, params)
}

export {
  open,
  goToEditPassword,
  goToSetPassword,
  goToLogoutAccountRe,
  goToLogoutAccount
}
